$OpenBSD: README,v 1.47 2017/04/28 10:41:45 ajacoutot Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

ownCloud is installed under
    ${INSTDIR}

Official documentation is available at:
    https://doc.owncloud.org/server/${VR}/admin_manual/

Post-installation instructions
==============================

*** It is highly recommended to use SSL on the webserver (HTTPS).

chroot(2)
---------
When running ownCloud with a chrooted web server, the UTF-8 locale files must be
copied under the /var/www chroot to prevent warning messages in the admin
configuration page and logs:
    # mkdir -p /var/www/usr/share/locale/UTF-8/
    # cp /usr/share/locale/UTF-8/LC_CTYPE \
        /var/www/usr/share/locale/UTF-8/

OpenBSD HTTP daemon
-------------------
See:
    https://github.com/reyk/httpd/wiki/Running-ownCloud-with-httpd-on-OpenBSD

nginx
-----
See:
    https://doc.owncloud.org/server/${VR}/admin_manual/installation/nginx_examples.html

Apache HTTPD
------------
Apache configuration for ownCloud is stored under:
    ${PREFIX}/conf/modules.sample/httpd-owncloud.conf

It needs to be enabled by running the following command after the apache-httpd
package is installed:
# ln -s ../modules.sample/httpd-owncloud.conf /var/www/conf/modules
# rcctl restart apache2

The rewrite_module needs to be enabled by uncommenting the following line in
${SYSCONFDIR}/apache2/httpd2.conf:
    #LoadModule rewrite_module /usr/local/lib/apache2/mod_rewrite.so

Apache also needs

PHP
---
Default PHP values for Apache are set under:
    ${TINSTDIR}/.htaccess

OpenBSD HTTP daemon users can match these .htaccess file values by editing
${SYSCONFDIR}/php-${MODPHP_VERSION}.ini or ${SYSCONFDIR}/php-fpm.conf.

nginx users can match these .htaccess file values by configuring fastcgi_param
with a PHP_VALUE in ${SYSCONFDIR}/nginx/nginx.conf.

For enhanced performance, a PHP opcode cache can be used, either use "opcache"
built-in to PHP 5.5+, enable "opcache.ini" to use it)
or install xcache.

Database configuration
----------------------
See the following URL for setting up a database for ownCloud:
    https://doc.owncloud.org/server/${VR}/admin_manual/configuration_database/linux_database_configuration.html

ownCloud can work with a PostgreSQL, MariaDB or SQLite3 database. Support for
SQLite3 is included with the main php package; to use another database, the
corresponding package needs to be installed *before* setting up ownCloud:
    php-pgsql or php-pdo_mysql

Configuration file
------------------
Configuration is done under:
    ${INSTDIR}/config/config.php
and the default "datadirectory" is set to:
    ${TINSTDIR}/data
When running chrooted, /var/www must be stripped from the paths.

Cron job
--------
ownCloud needs to run background jobs on a regular basis. By default, it will
execute one task with each page loaded ("AJAX" option in the admin interface).
The prefered way is to use a cron(8) job instead.
(see https://<hostname>/owncloud/index.php/settings/admin#backgroundjobs)
e.g.
*/15	*	*	*	*	su -m www -c "${LOCALBASE}/bin/php-5.6 -f ${INSTDIR}/cron.php"

Memory caching and file locking
-------------------------------
ownCloud server performance can be significantly improved with memory caching
and memory-based locking. Distributed caching and Transactional File Locking is
provided by Redis, an in-memory data structure store. More information and
configuration example are available at:
    https://doc.owncloud.org/server/${VR}/admin_manual/configuration_server/caching_configuration.html#id4

TL;DR
You need a redis server running (available in the redis package) then adapt and
append the following to:
    ${INSTDIR}/config/config.php

  'filelocking.enabled' => true,
  'memcache.local' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0.0,
    'password' => '', // Optional, if not defined no password will be used.
  ),

Authentication backends
-----------------------
When using a non-default user authentication backend (LDAP, IMAP, ...), extra
packages may be needed (e.g. php-ldap, php-imap).

Finishing and validating the installation
-----------------------------------------
Make sure the web server can resolve its hostname (e.g. if chrooted, by creating
/var/www/etc/hosts and/or /var/www/etc/resolv.conf).

Accessing https://<hostname>/owncloud with a Web browser will finish the
installation and create a new admin user.

Updating
========
Before updating to a new release, read:
    https://doc.owncloud.org/server/${VR}/admin_manual/maintenance/upgrade.html

When using a PostgreSQL or MariaDB, the corresponding MDB2 php package must be
installed to properly upgrade the database:
    php-pgsql or php-mysql

WebDAV access
=============
The personal WebDAV share can be accessed using the following URL (e.g. with
Nautilus, Thunar or Doplhin) and the corresponding user and password for the
share:
    https://<hostname>/owncloud/remote.php/webdav/

Synchronization
===============
The "owncloudclient" package (net/owncloudclient) is a graphical (QT)
application to synchronize with an ownCloud server.

Apps and dependencies
=====================
To keep dependencies to a minimum, not all dependencies for all installed apps
are enforced. It is the job of the administrator to manually install required
packages according to the non-default apps he wants to enable.
